The HTML <datalist> element contains a set of <option> elements that represent the values available for other controls.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
| Content categories | Flow content, phrasing content. |
|---|---|
| Permitted content | Either phrasing content or zero or more <option> elements. |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts phrasing content. |
| Permitted ARIA roles | None |
| DOM interface | HTMLDataListElement |
AttributesSection
This element has no other attributes than the global attributes, common to all elements.
ExamplesSection
<label for="myBrowser">Choose a browser from this list:</label>
<input list="browsers" id="myBrowser" name="myBrowser" />
<datalist id="browsers">
<option value="Chrome">
<option value="Firefox">
<option value="Internet Explorer">
<option value="Opera">
<option value="Safari">
<option value="Microsoft Edge">
</datalist>
ResultSection
SpecificationsSection
| Specification | Status | Comment |
|---|---|---|
| HTML Living Standard The definition of '<datalist>' in that specification. |
Living Standard | |
| HTML5 The definition of '<datalist>' in that specification. |
Recommendation |
Browser compatibilitySection
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Chrome Full support 20 | Edge Full support Yes | Firefox Full support 4 | IE Full support 10 | Opera Full support 9.5 | Safari No support No | WebView Android No support No | Chrome Android Full support 33 | Edge Mobile Full support Yes | Firefox Android Full support 4 | Opera Android ? | Safari iOS No support No | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
PolyfillSection
Include this polyfill to provide support for older and currently incompatible browsers:
datalist-polyfill